﻿<div class="widget-body widget-hide-overflow no-padding">
                        <!-- CHAT BODY -->
                        <div id="chat-body" class="chat-body custom-scroll">
                            <ul>
                                <li class="message load-older-replies" ng-show="topicReplies.hasOlderReplies && !topicReplies.showOlderReplies">
                                    <button class="btn btn-primary btn-xs" ng-click="loadOlderMessages(topic)">Load older replies</button>
                                    <indicator class="" style="color: #2C3742; margin-left: 5px; position: relative; top: 5px; line-height: 20px;" show="topicReplies.loadingOlderReplies"></indicator>
                                </li>
                                <li class="message" ng-repeat="reply in topicReplies.recentReplies">
                                    <div class="dmessage-avatar">
                                        <img ng-src="{{reply.imageUrl}}" class="online" alt="" ng-click="viewUserInfo(reply.from)">
                                    </div>
                                    <div class="message-text">
                                        <time>{{reply.when}}</time>
                                        <a href="#" class="username" ng-click="viewUserInfo(reply.from)">{{reply.from}}</a>
                                        <p ng-bind-html="reply.message"></p>
                                        <p class="chat-file row" ng-repeat="file in reply.attachments">
                                            <download-file file="file"></download-file>
                                        </p>
                                    </div>
                                </li>
                                <li class="message" ng-repeat="reply in topicReplies.olderReplies">
                                    <div class="dmessage-avatar">
                                        <img ng-src="{{reply.imageUrl}}" class="online" alt="" ng-click="viewUserInfo(reply.from)">
                                    </div>
                                    <div class="message-text">
                                        <time>{{reply.when}}</time>
                                        <a href="#" class="username" ng-click="viewUserInfo(reply.from)">{{reply.from}}</a>
                                        <p ng-bind-html="reply.message"></p>
                                        <p class="chat-file row" ng-repeat="file in reply.attachments">
                                            <download-file file="file"></download-file>
                                        </p>
                                    </div>
                                </li>
                                <li class="message topic-no-message" ng-if="topicReplies.recentReplies.length<=0">
                                    <div class="topic-no-message-text">No replies</div>
                                </li>
                            </ul>
                        </div>
                        <!-- CHAT FOOTER -->
                        <div class="chat-footer">
                            <form name="replyform" enctype="multipart/form-data" novalidate ui-keypress="{13:'submitReply(reply,topic,false)'}" ng-class="{'has-error': validate('body','required'),'has-error has-error-maxlength': validate('body','maxlength')}">
                                <!-- CHAT TEXTAREA -->
                                <div class="textarea-div">

                                    <div class="typearea">
                                        <textarea placeholder="Write a reply..." id="textarea-expand" name="body" class="custom-scroll" required ng-model="reply.body" ui-keypress="{13:'preventNewLine(reply,$event)'}" textareamaxlengthwithbr="500"></textarea>
                                    </div>
                                </div>

                                <!-- CHAT REPLY/SEND -->
                                <span class="textarea-controls">
                                    <indicator class="pull-right fa-2x" style="color: #2C3742; margin: 3px 0 0 5px; line-height: 21px;" show="isPosting"></indicator>
                                    <button class="btn btn-sm btn-primary pull-right btnAddReply" type="submit" ng-click="submitReply(reply,topic,true)" ng-disabled="isPosting">
                                        Reply
                                    </button>
                                    <span class="pull-right smart-form" style="margin-top: 3px; margin-right: 10px;">
                                        <label class="checkbox pull-right">
                                            <input type="checkbox" ng-model="reply.entertosend">
                                            <i></i>Press <strong>ENTER </strong>to send
                                        </label>
                                    </span>

                                    <a href="javascript:void(0);" class="pull-left uploadbutton"><i class="fa fa-camera fa-fw fa-lg"></i></a>
                                    <span class="file-upload-warning">Max files: 3 (0.5MB each file). <span class="allowedExtension">Accept: {{allowedExtension}}</span></span>
                                    <span class="btnupload"></span>
                                </span>
                                <span class="textarea-controls error-block max-length-error">
                                    <span class="help-block">The message is too long. (500 is maximum)</span>
                                </span>
                                <div class="alert alert-info alert-block" ng-show="reply.attachments.length">
                                    <h4 class="alert-heading">Attach Files</h4>
                                    <ul>
                                        <li ng-repeat="file in reply.attachments" class="attach-file"><span>{{file.name}}</span>
                                            <span class="label label-danger btnRemoveAttachment" ng-click="deleteCurrentAttachment($index,$event)"><i class="fa fa-fw fa-minus-circle"></i>Remove</span>
                                        </li>
                                    </ul>
                                </div>
                                <div class="alert alert-warning fade in" ng-show="floodError">
                                    <i class="fa-fw fa fa-warning"></i>
                                    <strong>Warning</strong> You have to wait {{replyFlood}} second(s) to continue.
                                </div>
                                <div class="alert alert-danger fade in" ng-show="hasErrorWhilePosting">
                                    <i class="fa-fw fa fa-times"></i>
                                    <strong>Error</strong> {{errorMessage}}
                                </div>
                            </form>
                        </div>

                        <!-- end content -->
                    </div>